﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Data;

namespace ESC.Designer.Resources
{
    public class MachineRepairFromConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null)
            {
                return "错误";
            }
            else
              if (value.ToString() == "0")
            {
                return "未結案";
            }
            else if (value.ToString() == "1")
            {
                return "pending";
            }
            else 
            {
                return "結案";
            }
            
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public enum MachineRepairFrom
    {
        未結案 = '0',
        pending = '1',
        結案 = '2'
    }
}
